Skip to content

fix(scheduler): namespace PodGroup identities - #2095

Open
nvyutwu wants to merge 1 commit into
kai-scheduler:mainfrom
nvyutwu:fix/podgroup-namespaced-identity
Open

fix(scheduler): namespace PodGroup identities#2095
nvyutwu wants to merge 1 commit into
kai-scheduler:mainfrom
nvyutwu:fix/podgroup-namespaced-identity

Conversation

@nvyutwu

@nvyutwu nvyutwu commented Aug 22, 2026

Copy link
Copy Markdown

Description

PodGroup is a namespaced Kubernetes resource, but the scheduler cache used only PodGroup.Name for three related identities:

  • the pod informer index,
  • the snapshot's PodGroupInfos map, and
  • the job ID assigned to pods in the snapshot.

As a result, same-named PodGroups in different namespaces collided. One snapshot entry overwrote the other and pods from both namespaces could be attached to one group. This could make topology allocations owned by one workload appear to belong to another workload and incorrectly remove otherwise available nodes from consideration.

This change introduces a canonical namespace/name PodGroup ID and uses it consistently at the cache boundary. Pods without a PodGroup annotation retain the existing empty index key.

A regression test creates live/shared-name and shadow/shared-name with one pod each. Before the fix, the test observes one merged group; after the fix, it observes two isolated groups whose pods carry the correct namespaced job ID.

Related Issues

N/A

Checklist

  • Self-reviewed
  • Added/updated tests
  • Documentation not required (internal cache identity fix)
  • Added a changelog fragment via make changelog

Breaking Changes

None. The change affects internal scheduler cache keys only.

Additional Notes

Validation on an x86_64 Linux workstation:

  • go test ./pkg/scheduler/... -count=1
  • go vet ./pkg/scheduler/...
  • golangci-lint run -v -c .golangci.yaml ./pkg/scheduler/...
  • go build -buildvcs=false ./cmd/scheduler

The regression is deterministic cache bookkeeping and does not require a multi-node GPU cluster.

Signed-off-by: Yuting Wu (DLAlgo) <yutwu@nvidia.com>
@nvyutwu
nvyutwu marked this pull request as ready for review August 22, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant